package wsdc.app.main;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.embedded.tomcat.TomcatProtocolHandlerCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

import org.springframework.http.converter.HttpMessageConverter;


import java.util.List;
import java.util.concurrent.Executors;
@SpringBootApplication

//@EnableFeignClients(basePackages = {"wsdc.common","com.example.demo"})
//@ImportAutoConfiguration({FeignAutoConfiguration.class})

@Slf4j
public class DemoApplication implements BeanDefinitionRegistryPostProcessor {
	@Autowired
	List<HttpMessageConverter> a;

	public static void main(String[] args) {
		//a();
		//b();



		SpringApplication.run(DemoApplication.class, args);

		//ToolProvider.getSystemJavaCompiler()
	}
	//	tomcat使用虚拟线程池
	@Bean
	TomcatProtocolHandlerCustomizer<?> protocolHandlerVirtualThreadExecutorCustomizer() {
		return protocolHandler ->{
			protocolHandler.setExecutor (Executors.newVirtualThreadPerTaskExecutor());
		};
	}

	@Override
	public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {

	}

	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {

	}


}